package com.atguigu.blog.service.impl;

import com.atguigu.blog.dao.ArticleCommentDao;
import com.atguigu.blog.pojo.ArticleComment;
import com.atguigu.blog.service.ArticleCommentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = false)
public class ArticleCommentServiceImpl extends ServiceImpl<ArticleCommentDao, ArticleComment> implements ArticleCommentService {
    @Override
    public List<ArticleComment> findById(String id) {
        QueryWrapper<ArticleComment> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("article_id", id);
        List<ArticleComment> articleComments = baseMapper.selectList(queryWrapper);
        return articleComments;
    }
}
